Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

135
Visualizações
Animate image "roll" using JavaScript

In NumPy, there is a function called roll. The documentation describes it as follows:

Roll array elements along a given axis.

Elements that roll beyond the last position are re-introduced at the first.

Concretely, calling roll on an image could produce the following shifted version:

enter image description here

My question is how to achieve the same effect in JavaScript for arbitrary shift values along the width and height axes and how to make it animatable, such that one can see the transition from the original image to the shifted version.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

So the answer is embarrassingly simple. It can be achieved like so:

#imageDiv {
  background-image: url(the_image.png);
  background-repeat: repeat;
}

After which you can simply animate the background-position property on imageDiv (for instance background-position: 42px 69px).

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda